package com.wlyuan.open.scanner.utils.enums.transport;

import com.wlyuan.core.marker.NamedValue;
import com.wlyuan.core.marker.NamedValueMap;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.RequiredArgsConstructor;

import java.util.Map;

/**
 * @author lijing
 * @description 老系统回单类型
 */
@RequiredArgsConstructor(access = AccessLevel.PRIVATE)
@Getter
public enum WaybillTypeEnum implements NamedValue<Integer> {

    /**
     * 发货方运单
     */
    CUSTOMER_WAYBILL(1, 10, "发货方运单"),

    /**
     * 承运方运单
     */
    CARRIERS_WAYBILL(2, 20, "承运方运单"),
    ;

    private final Integer value;
    private final Integer newValue;
    private final String name;

    private static final Map<Integer, WaybillTypeEnum> MAP = new NamedValueMap<>(WaybillTypeEnum.class);

    public static WaybillTypeEnum fromValue(Long value) {
        return MAP.get(value.intValue());
    }

}
